package com.backstage.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.backstage.entity.po.SysUser;
import com.backstage.service.ISysUserService;

@Controller
@RequestMapping(value="/userManagement")
public class UserManagementController extends BaseController{

	@Autowired
	private ISysUserService sysUserService;
	
	@ResponseBody
	@RequestMapping(value="/allUser",method=RequestMethod.GET)
	public ModelAndView allUser(ModelAndView modelAndView){
		modelAndView.setViewName("system/datalist");
		return modelAndView;
	}
	
/*	@ResponseBody
	@RequestMapping(value="/userPage")
	public Object selectPage(Model model,int current,int pageSize){
		Page<SysUser> page = new Page<SysUser>(1,2);
		page = sysUserService.selectUserList(page, "NORMAL");
		List<SysUser> userList = page.getRecords();
		
		return page;
	}*/
	
	@ResponseBody
	@RequestMapping(value="/userPage",method=RequestMethod.POST)
	public List<SysUser> selectPage(){
		List<SysUser> userList = sysUserService.findAllUser();
		System.out.println(userList.get(1).getUpdateTime());
		return userList;
	}
	
	
}
